package bean.validate;

import java.io.Serializable;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;

@ManagedBean(name="updatev")
@ViewScoped
public class UpdateValidate implements Serializable {
	private static final long serialVersionUID = 8048446519596040884L;
	
	// Validation
	public void name() {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "ok");
		FacesContext.getCurrentInstance().addMessage("form_update:name", message);
	}
	
	public void surName() {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "ok");
		FacesContext.getCurrentInstance().addMessage("form_update:surname", message);
	}
	
	public void email() {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "ok");
		FacesContext.getCurrentInstance().addMessage("form_update:email", message);
	}

	public void birthDate() {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "ok");
		FacesContext.getCurrentInstance().addMessage("form_update:birthdate", message);
	}
	
	public void gender() {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "ok");
		FacesContext.getCurrentInstance().addMessage("form_update:gender", message);
	}
	
	public void password() {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "ok");
		FacesContext.getCurrentInstance().addMessage("form_update:password", message);
	}
	
	public void passwordOld() {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "ok");
		FacesContext.getCurrentInstance().addMessage("form_update:password_old", message);
	}
	
	public void validate(String id) {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "ok");
		FacesContext.getCurrentInstance().addMessage("form_update:" + id, message);
	}


}
